(function () {
    'use strict';

    angular.module('app').service('SysUserService', SysUserService);

    SysUserService.$inject = [
        'A',
        'Api'
    ];

    function SysUserService(A, Api) {

        var userService = {
            get   : get,
            update: update,
            create: create,
            remove: remove
        };

        function get(ik) {
            return A.Ajax.get(Api.sys.user.get(ik));
        }

        function update(name, ik) {
            return A.Ajax.post(Api.sys.user.update, {
                name: name,
                ik  : ik
            });
        }

        function create(sysUser) {
            return A.Ajax.post(Api.sys.user.create, sysUser);
        }

        function remove(ik) {
            return A.Ajax.post(Api.sys.user.remove(ik));
        }

        return userService;
    }
})();